<!-- HTML header for doxygen 1.9.7-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.13.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<title>libsir: The Standard Incident Reporter Library</title>
<!-- OpenGraph -->
<meta property="og:title" content="libsir: The Standard Incident Reporter Library">
<meta property="og:description" content="A lightweight, cross-platform C library for information distribution">
<meta property="og:url" content="https://libsir.rml.dev">
<meta property="og:type" content="website">
<meta property="og:image" content="https://libsir.rml.dev/res/libsir-og.png">
<meta name="twitter:card" content="summary_large_image"></meta>
<meta name="twitter:title" content="libsir: The Standard Incident Reporter Library"></meta>
<meta name="twitter:description" content="A lightweight, cross-platform C library for information distribution"></meta>
<meta name="twitter:image" content="https://libsir.rml.dev/res/libsir-og.png"></meta>
<!-- /OpenGraph -->
<!-- favicon -->
<link rel="icon" href="res/libsir-icon.png">
<link rel="icon" href="res/libsir-icon.svg" type="image/svg+xml">
<link rel="manifest" href="res/icons.webmanifest">
<!-- /favicon -->
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
<link href="rml-navtree.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libsir<span id="projectnumber">&#160;2.2.6</span>
   </div>
   <div id="projectbrief">Standard Incident Reporter</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.13.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search',true);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('config.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div><div class="header">
  <div class="headertitle"><div class="title">Configuration</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="anchor" id="md_docs_2sources_2config"></a></p>
<p>Compile-time configuration of libsir.</p>
<h1>Environment variables</h1>
<p>The variables in the following table are applied at compile-time when executing <code>make</code>.</p>
<p><b>Example:</b></p>
<div class="fragment"><div class="line">env SIR_PREPROCESSOR_FOO=1 make ...</div>
</div><!-- fragment --><p>The Makefile takes care of the rest; for each environment variable that is known to the Makefile, it adds or removes compiler options based on the values provided. This may be a simple mapping of <code>VAR=1</code> to <code>-DVAR</code>, or a more nuanced configuration:</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter">Variable (default)   </th><th class="markdownTableHeadCenter">State   </th><th class="markdownTableHeadCenter">Compiler settings   </th><th class="markdownTableHeadLeft">Description    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter" rowspan="2"><code>SIR_DEBUG (0)</code>   </td><td class="markdownTableBodyCenter"><code>0</code>   </td><td class="markdownTableBodyCenter"><code>-O3 -DNDEBUG -D_FORTIFY_SOURCE=2</code>   </td><td class="markdownTableBodyLeft">Full optimization is applied, source fortification is set to level 2, and no debugging symbols are included.    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>1</code>   </td><td class="markdownTableBodyCenter"><code>-g3 -00 -DDEBUG -U_FORTIFY_SOURCE</code>   </td><td class="markdownTableBodyLeft">No optimizations are applied, source fortification is disabled, and full debugging symbols are included.    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter" rowspan="2"><code>SIR_SELFLOG (0)</code>   </td><td class="markdownTableBodyCenter"><code>0</code>   </td><td class="markdownTableBodyCenter"><code>N/A</code>   </td><td class="markdownTableBodyLeft">NOOP    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>1</code>   </td><td class="markdownTableBodyCenter"><code>-DSIR_SELFLOG</code>   </td><td class="markdownTableBodyLeft">Diagnostic information is sent to <code>stderr</code> to report certain events that may aid in debugging. Includes the function name, source file, and line where the event took place. If <code>SIR_DEBUG</code> and <code>SIR_SELFLOG</code> are enabled, each error handled internally will be logged in real time as it is captured.    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter" rowspan="2"><code>SIR_ASSERT_ENABLED (0)</code>   </td><td class="markdownTableBodyCenter"><code>0</code>   </td><td class="markdownTableBodyCenter"><code>N/A</code>   </td><td class="markdownTableBodyLeft"><code>assert</code> will never be called. If <code>SIR_SELFLOG</code> is enabled, where asserts normally would take place, a <code>_sir_selflog</code> call is made, producing output to stderr such as '<code>somefunc (file.c:123): !!! would be asserting (NULL != ptr)</code>'.    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>1</code>   </td><td class="markdownTableBodyCenter"><code>-DSIR_ASSERT_ENABLED</code>   </td><td class="markdownTableBodyLeft"><code>assert</code> will be used. Note that assert has no effect if <code>NDEBUG</code> is defined, so in order for this to be useful, you will also need <code>SIR_DEBUG=1</code> (<em>or manually change <code>-DNDEBUG</code> to <code>-DDEBUG</code> in the Makefile</em>).    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter" rowspan="2"><code>SIR_NO_SYSTEM_LOGGERS (0)</code>   </td><td class="markdownTableBodyCenter"><code>0</code>   </td><td class="markdownTableBodyCenter"><code>N/A</code>   </td><td class="markdownTableBodyLeft">If the current platform has a system logger facility (<em>currently all platforms do by default except Windows</em>), you can utilize it as a destination in libsir.    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>1</code>   </td><td class="markdownTableBodyCenter"><code>-DSIR_NO_SYSTEM_LOGGERS</code>   </td><td class="markdownTableBodyLeft">Even if the current platform has a system logger facility, the functionality will be disabled (<em>and most of it compiled out</em>).    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter" rowspan="2"><code>SIR_NO_PLUGINS (0)</code>   </td><td class="markdownTableBodyCenter"><code>0</code>   </td><td class="markdownTableBodyCenter"><code>N/A</code>   </td><td class="markdownTableBodyLeft">The plugin system is available for use. Call <a class="el" href="group__publicfuncs.html#ga1a50b52b3ce1af7543b76a219ff01060" title="Loads a plugin module from disk.">sir_loadplugin</a> to load a plugin, and <a class="el" href="group__publicfuncs.html#ga6796c068e61eb505e8dd8e230fbc1423" title="Unloads a previously registered plugin module.">sir_unloadplugin</a> to unload one.    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>1</code>   </td><td class="markdownTableBodyCenter"><code>-DSIR_NO_PLUGINS</code>   </td><td class="markdownTableBodyLeft">The plugin system's functionality will be disabled (<em>and most of it compiled out</em>).    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter" rowspan="2"><code>SIR_NO_SHARED (0)</code>   </td><td class="markdownTableBodyCenter"><code>0</code>   </td><td class="markdownTableBodyCenter"><code>N/A</code>   </td><td class="markdownTableBodyLeft">Shared libraries are created when building the <em><code>all</code></em> target, and installed with <em><code>make install</code></em>.    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>1</code>   </td><td class="markdownTableBodyCenter"><code>-DSIR_NO_PLUGINS</code>   </td><td class="markdownTableBodyLeft">The <code>SIR_NO_PLUGINS</code> variable is set (to <code>1</code>), shared libraries are not created when building the <em><code>all</code></em> target, and are not installed with <em><code>make install</code></em>.    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter" rowspan="2"><code>SIR_USE_EOL_CRLF (0)</code>   </td><td class="markdownTableBodyCenter"><code>0</code>   </td><td class="markdownTableBodyCenter"><code>N/A</code>   </td><td class="markdownTableBodyLeft">The end of line sequence will be SIR_EOL_LF.    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>1</code>   </td><td class="markdownTableBodyCenter"><code>-DSIR_USE_EOL_CRLF</code>   </td><td class="markdownTableBodyLeft">The end of line sequence will be SIR_EOL_CR + SIR_EOL_LF.   </td></tr>
</table>
<hr  />
<dl class="section note"><dt>Note</dt><dd>If you plan to use the Visual Studio 2022 solution, see <code>README.md</code> under <code>Help</code> once the solution is loaded.</dd></dl>
<h1>sirconfig.h</h1>
<p>All of the fine-grained compile-time constants, such as (but not limited to):</p>
<ol type="1">
<li>Date/time format strings</li>
<li>Default values</li>
<li>Miscellaneous format strings</li>
<li>Buffer sizes</li>
<li>Thresholds</li>
</ol>
<p>can be found in <a href="https://github.com/aremmell/libsir/blob/master/include/sir/config.h">config.h</a>, and may be modified to fit your specific needs.</p>
<dl class="section remark"><dt>Remarks</dt><dd>All format strings containing specifiers such as <code>%d</code> are <code>printf</code>-style. The man page or documentation for <code>printf</code> can be used as a guide.</dd></dl>
<dl class="section attention"><dt>Attention</dt><dd>Don't make changes until you've examined how these values are utilized elsewhere in the source code! You <em>will</em> break something. </dd></dl>
</div></div><!-- contents -->
</div><!-- PageDoc -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.9.7-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
  </ul>
</div>
</body>
</html>
